package State;

public class StatePatternDemo {

    public static void main(String[] args) {
        Context context = new Context();

        StartState startState = new StartState();
        startState.doAction(context); // 设置context对象的状态 为 当前State 类型(接口).
        System.out.println("当前操作后的 context 对象的 state 状态: " + context.getState().toString());

        StopState stopState = new StopState();
        stopState.doAction(context);
        System.out.println("当前操作后的 context 对象的 state 状态: " + context.getState().toString());
    }
}
